package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_employee")
public class EmployeeBean {
    @TableId(value = "pk_emId",type = IdType.AUTO)
    private Integer id;
    @TableField("e_name")
    private String name;
    @TableField("e_birthday")
    private LocalDate birthday;
    @TableField(exist = false)
    private DeptBean dept;
    @TableField("fk_deptId")
    private Integer deptId;

    public EmployeeBean() {
    }

    public EmployeeBean(String name, LocalDate birthday) {
        this.name = name;
        this.birthday = birthday;
    }

    public EmployeeBean(String name, LocalDate birthday, Integer deptId) {
        this.name = name;
        this.birthday = birthday;
        this.deptId = deptId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LocalDate getBirthday() {
        return birthday;
    }

    public void setBirthday(LocalDate birthday) {
        this.birthday = birthday;
    }

    public DeptBean getDept() {
        return dept;
    }

    public void setDept(DeptBean dept) {
        this.dept = dept;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    @Override
    public String toString() {
        return "EmployeeBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", birthday=" + birthday +
                ", dept=" + dept +
                ", deptId=" + deptId +
                '}';
    }
}
